<div class="modal fade" id="menuFormModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px">
        <form class="form-horizontal" role="form" method="post" action="/menu/add" id="saveForm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="myModalLabel">新增菜单</h4>
                </div>
                <div class="modal-body clearfix">
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">菜单名称</label>
                        <div class="col-xs-9">
                            <div>
                                <input type="text" name="name" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">上级菜单ID</label>
                        <div class="col-xs-4">
                            <div>
                                <input type="text" name="pid" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">链接地址</label>
                        <div class="col-xs-9">
                            <div>
                                <input type="text" name="url" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">图标</label>
                        <div class="col-xs-6">
                            <div>
                                <input type="text" name="icon" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">操作控制</label>
                        <div class="col-xs-9">
                            <div>
                                <textarea class="form-control" name="actions"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">备注</label>
                        <div class="col-xs-9">
                            <div>
                                <textarea name="remark" class="form-control"></textarea>
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">是否显示</label>
                        <div class="col-xs-9">
                            <label class="checkbox inline">
                                <input type="checkbox" class="ace ace-switch ace-switch-7" value="1" name="is_show">
                                <span class="lbl"></span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">新标签页打开</label>
                        <div class="col-xs-9">
                            <label class="checkbox inline">
                                <input type="checkbox" class="ace ace-switch ace-switch-7" value="1" name="is_target">
                                <span class="lbl"></span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">是否测试</label>
                        <div class="col-xs-9">
                            <label class="checkbox inline">
                                <input type="checkbox" class="ace ace-switch ace-switch-7" value="1" name="is_test">
                                <span class="lbl"></span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-3">排序值</label>
                        <div class="col-xs-6">
                            <div>
                                <input type="text" name="sort" class="form-control">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-remove"></i> 取消</button>
                    <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    $(document)
        .on('hide.bs.modal', '#menuFormModal', function(e) {
            $(this).remove();
        })
        .on('show.bs.modal', '#menuFormModal', function(e) {
            var that = $(this)
            ace.form.ajaxSub('#saveForm', function() {
                refreshTable()
                that.remove()
            })
        })
</script>
